Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix failure for the initial gpg key load on Pop!_OS #428

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

shuuji3
Copy link
Contributor

@shuuji3 shuuji3 commented Oct 2, 2023

Hi, this is a follow-up PR for #396.

The previous PR fixed docker_apt_repository issue by using docker_apt_ansible_distribution, but we also needed it in docker_apt_gpg_key.

This gpg key needs to be added only once, so I assume the previous environment already had the gpg key for Ubuntu installed in the system.

Additional info: error logs without this change on the latest role (v7.0.1):

(...)

TASK [geerlingguy.docker : Load OS-specific vars.] *****************************
task path: /home/shuuji3/.ansible/roles/geerlingguy.docker/tasks/main.yml:2
ok: [localhost] => {"ansible_facts": {}, "ansible_included_var_files": ["/home/shuuji3/.ansible/roles/geerlingguy.docker/vars/main.yml"], "changed": false}

TASK [geerlingguy.docker : include_tasks] **************************************
task path: /home/shuuji3/.ansible/roles/geerlingguy.docker/tasks/main.yml:13
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [geerlingguy.docker : include_tasks] **************************************
task path: /home/shuuji3/.ansible/roles/geerlingguy.docker/tasks/main.yml:16
included: /home/shuuji3/.ansible/roles/geerlingguy.docker/tasks/setup-Debian.yml for localhost

TASK [geerlingguy.docker : Ensure old versions of Docker are not installed.] ***
task path: /home/shuuji3/.ansible/roles/geerlingguy.docker/tasks/setup-Debian.yml:2
ok: [localhost] => {"changed": false}

TASK [geerlingguy.docker : Ensure dependencies are installed.] *****************
task path: /home/shuuji3/.ansible/roles/geerlingguy.docker/tasks/setup-Debian.yml:9
ok: [localhost] => {"cache_update_time": 1696254271, "cache_updated": false, "changed": false}

TASK [geerlingguy.docker : Ensure additional dependencies are installed (on Ubuntu < 20.04 and any other systems).] ***
task path: /home/shuuji3/.ansible/roles/geerlingguy.docker/tasks/setup-Debian.yml:17
ok: [localhost] => {"cache_update_time": 1696254271, "cache_updated": false, "changed": false}

TASK [geerlingguy.docker : Ensure additional dependencies are installed (on Ubuntu >= 20.04).] ***
task path: /home/shuuji3/.ansible/roles/geerlingguy.docker/tasks/setup-Debian.yml:23
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [geerlingguy.docker : Add Docker apt key.] ********************************
task path: /home/shuuji3/.ansible/roles/geerlingguy.docker/tasks/setup-Debian.yml:29
fatal: [localhost]: FAILED! => {"changed": false, "dest": "/etc/apt/trusted.gpg.d/docker.asc", "elapsed": 0, "msg": "Request failed", "response": "HTTP Error 404: Not Found", "status_code": 404, "url": "https://download.docker.com/linux/pop!_os/gpg"}
...ignoring

TASK [geerlingguy.docker : Ensure curl is present (on older systems without SNI).] ***
task path: /home/shuuji3/.ansible/roles/geerlingguy.docker/tasks/setup-Debian.yml:40
ok: [localhost] => {"cache_update_time": 1696254271, "cache_updated": false, "changed": false}

TASK [geerlingguy.docker : Add Docker apt key (alternative for older systems without SNI).] ***
task path: /home/shuuji3/.ansible/roles/geerlingguy.docker/tasks/setup-Debian.yml:44
[WARNING]: Consider using the get_url or uri module rather than running 'curl'.
If you need to use command because get_url or uri is insufficient you can add
'warn: false' to this command task or set 'command_warnings=False' in
ansible.cfg to get rid of this message.
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "curl -sSL https://download.docker.com/linux/pop!_os/gpg | apt-key add -\n", "delta": "0:00:00.238957", "end": "2023-10-02 22:56:13.330414", "msg": "non-zero return code", "rc": 2, "start": "2023-10-02 22:56:13.091457", "stderr": "Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).\ngpg: no valid OpenPGP data found.", "stderr_lines": ["Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).", "gpg: no valid OpenPGP data found."], "stdout": "", "stdout_lines": []}

PLAY RECAP *********************************************************************
localhost                  : ok=15   changed=1    unreachable=0    failed=1    skipped=5    rescued=0    ignored=1   

make: *** [/home/shuuji3/dev/ansible-setup-env/pop_os/Makefile:4: setup] Error 2
make: Leaving directory '/home/shuuji3/dev/ansible-setup-env/pop_os'

Process finished with exit code 2

The role was trying to download gpg key by

curl -sSL https://download.docker.com/linux/pop!_os/gpg | apt-key add -

but it must be

curl -sSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

@geerlingguy geerlingguy merged commit 15815e5 into geerlingguy:master Oct 5, 2023
9 checks passed
@shuuji3 shuuji3 deleted the fix/gpg-key-error-on-popos branch October 6, 2023 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants